<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录界面</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery/jquery.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/plupload/plupload.full.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery/jquery-ui/jquery-ui.js"></script>

<script
	src="${pageContext.request.contextPath}/js/bootstrap/bootstrap.js"
	type="text/javascript"></script>
<script
	src="${pageContext.request.contextPath}/ui/table/bootstrap-table.js"
	type="text/javascript"></script>
<script
	src="${pageContext.request.contextPath}/ui/table/plugins/tableExport.js"
	type="text/javascript"></script>
<script
	src="${pageContext.request.contextPath}/ui/table/plugins/table-export.js"
	type="text/javascript"></script>
<script
	src="${pageContext.request.contextPath}/ui/table/plugins/jquery.base64.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/ui/layui/layui.js"
	type="text/javascript"></script>
<script
	src="${pageContext.request.contextPath}/ui/layui/lay/modules/laydate.js"
	type="text/javascript"></script>



<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/bootstrap-css/bootstrap.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/login.css">



<style>
</style>

</head>

<body>
	<div class="container">
		<div class="row">
			<div class=" col-md-offset-3 col-md-6" id="loginform">
				<form class="form-horizontal"
					name="login-form" id="login-form">


					<span class="heading" style="font-size:30px">易数宝广告投放智能决策系统</span>

					<div class="alert alert-error" style="display:none">
						<a class="close" data-dismiss="alert">×</a> <strong></strong>
					</div>
					<div class="alert alert-success" style="display:none">
						<a class="close" data-dismiss="alert">×</a> <strong>登录成功</strong>
					</div>
					<div class="alert alert-info" style="display:none">
						<a class="close" data-dismiss="alert">×</a> <strong>Info!</strong>Watch
						this, but you may forget.
					</div>
					<div class="form-group">
						<input type="text" name="username" class="form-control"
							id="inputUser3" placeholder="用户名"> <i class="fa fa-user"></i>
					</div>
					<div class="form-group help">
						<input type="password" name="password" class="form-control"
							id="inputPassword3" placeholder="密　码"> <i
							class="fa fa-lock"></i> <a href="#" class="fa fa-question-circle"></a>
					</div>
					<div class="form-group">
						
						
						<button type="button" class="submit btn btn-default">登录</button>
					</div>
				</form>
			</div>
		</div>
	</div>
<script type="text/javascript">
$(document).keydown(function(event){ 
	if(event.keyCode==13){ 
	$(".submit").click(); 
	} 
}); 
</script>	
<script type="text/javascript">
$loginform = $("#loginform");
$('.submit').click(
		function(){
			$.ajax({
			    type: 'post',
			    url: '${pageContext.request.contextPath}/checkUser.do',
			    data: $("#login-form").serialize(),
			    success: function(data) {
			    	data = data.replace('"','').replace('"','');
			    	$(".alert-error").text(data);
			    	$(".alert-error").show();
			    	if('1'==data){
			    		$(".alert-error").hide();
			    		$(".alert-success").show();
			    		
			    	}
			        setTimeout("$(location).attr('href','${pageContext.request.contextPath}/userIndex.do')", 500);
			        ;
			    }
			});
			
		}
		
		
		
		);

</script>	
</body>
</html>